package com.wecon.springdemo.pattern.template.order;

import com.wecon.springdemo.mapper.TemplateMapper;

import javax.annotation.Resource;

/**
 * @author Weikang  Wang
 * @program: com.wecon.springdemo.pattern.template.order
 * @description:
 * @date 2020/5/11 13:32
 */
public class Application {

     public static String jsonA = "[{\n" +
//            "\"orderList\":  [{\n" +
            "\"orderId\":  \"2019030270001\",\n" +
            "\"orderPrice\":  \"100\",\n" +
            "\"productId\":  \"100\",\n" +
            "\"productCount\":  \"2\",\n" +
            "\"payPrice\":  \"200\",\n" +
            "\"realPayPrice\":  \"200\",\n" +
            "\"userId\":  \"1\",\n" +
            "\"orderDate\":  \"2020-03-24\",\n" +
            "\"payStatus\":  \"0\"\n" +
            "},  {\n" +
            "\"orderId\":  \"2019030270002\",\n" +
            "\"orderPrice\":  \"200\",\n" +
            "\"productId\":  \"101\",\n" +
            "\"productCount\":  \"3\",\n" +
            "\"payPrice\":  \"300\",\n" +
            "\"realPayPrice\":  \"300\",\n" +
            "\"userId\":  \"1\",\n" +
            "\"orderDate\":  \"2020-03-25\",\n" +
            "\"payStatus\":  \"1\"\n" +
            "},  {\n" +
            "\"orderId\":  \"2019030270003\",\n" +
            "\"orderPrice\":  \"300\",\n" +
            "\"productId\":  \"102\",\n" +
            "\"productCount\":  \"1\",\n" +
            "\"payPrice\":  \"300\",\n" +
            "\"realPayPrice\":  \"300\",\n" +
            "\"userId\":  \"5\",\n" +
            "\"orderDate\":  \"2020-03-26\",\n" +
            "\"payStatus\":  \"1\"\n" +
            "},  {\n" +
            "\"orderId\":  \"2019030270004\",\n" +
            "\"orderPrice\":  \"100\",\n" +
            "\"productId\":  \"107\",\n" +
            "\"productCount\":  \"2\",\n" +
            "\"payPrice\":  \"200\",\n" +
            "\"realPayPrice\":  \"200\",\n" +
            "\"userId\":  \"5\",\n" +
            "\"orderDate\":  \"2020-03-26\",\n" +
            "\"payStatus\":  \"0\"\n" +
//            "}]\n" +
            "}]";
     public static String jsonB = "[{\n" +
//            "\"orderList\":  [{\n" +
            "\"orderNo\":  \"2019030270001\",\n" +
            "\"orderMoney\":  \"100\",\n" +
            "\"merchantId\":  \"100\",\n" +
            "\"merchantCount\":  \"2\",\n" +
            "\"money\":  \"200\",\n" +
            "\"realMoney\":  \"200\",\n" +
            "\"memberId\":  \"1\",\n" +
            "\"orderTime\":  \"2020-03-24\"\n" +
            "},  {\n" +
            "\"orderNo\":  \"2019030270002\",\n" +
            "\"orderMoney\":  \"200\",\n" +
            "\"merchantId\":  \"101\",\n" +
            "\"merchantCount\":  \"3\",\n" +
            "\"money\":  \"300\",\n" +
            "\"realMoney\":  \"300\",\n" +
            "\"memberId\":  \"1\",\n" +
            "\"orderTime\":  \"2020-03-25\"\n" +
            "},  {\n" +
            "\"orderNo\":  \"2019030270003\",\n" +
            "\"orderMoney\":  \"300\",\n" +
            "\"merchantId\":  \"102\",\n" +
            "\"merchantCount\":  \"1\",\n" +
            "\"money\":  \"300\",\n" +
            "\"realMoney\":  \"300\",\n" +
            "\"memberId\":  \"5\",\n" +
            "\"orderTime\":  \"2020-03-26\"\n" +
            "},  {\n" +
            "\"orderNo\":  \"2019030270004\",\n" +
            "\"orderMoney\":  \"100\",\n" +
            "\"merchantId\":  \"107\",\n" +
            "\"merchantCount\":  \"2\",\n" +
            "\"money\":  \"200\",\n" +
            "\"realMoney\":  \"200\",\n" +
            "\"memberId\":  \"5\",\n" +
            "\"orderTime\":  \"2020-03-26\"\n" +
//            "}]\n" +
            "}]";
     public static String jsonC = "[{\n" +
//            "\"orderList\":  [{\n" +
            "\"order_id\":  \"2019030270001\",\n" +
            "\"order_price\":  \"100\",\n" +
            "\"product_id\":  \"100\",\n" +
            "\"product_count\":  \"2\",\n" +
            "\"pay_price\":  \"200\",\n" +
            "\"real_pay_price\":  \"200\",\n" +
            "\"user_id\":  \"1\",\n" +
            "\"order_date\":  \"2020-03-24\",\n" +
            "\"pay_status\":  \"0\"\n" +
            "},  {\n" +
            "\"order_id\":  \"2019030270002\",\n" +
            "\"order_price\":  \"200\",\n" +
            "\"product_id\":  \"101\",\n" +
            "\"product_count\":  \"3\",\n" +
            "\"pay_price\":  \"300\",\n" +
            "\"real_pay_price\":  \"300\",\n" +
            "\"user_id\":  \"1\",\n" +
            "\"order_date\":  \"2020-03-25\",\n" +
            "\"pay_status\":  \"1\"\n" +
            "},  {\n" +
            "\"order_id\":  \"2019030270003\",\n" +
            "\"order_price\":  \"300\",\n" +
            "\"product_id\":  \"102\",\n" +
            "\"product_count\":  \"1\",\n" +
            "\"pay_price\":  \"300\",\n" +
            "\"real_pay_price\":  \"300\",\n" +
            "\"user_id\":  \"5\",\n" +
            "\"order_date\":  \"2020-03-26\",\n" +
            "\"pay_status\":  \"1\"\n" +
            "},  {\n" +
            "\"order_ id\": \"2019030270004\",\n" +
            "\"order_price\": \"100\",\n" +
            "\"product_id\": \"107\",\n" +
            "\"product_count\": \"2\",\n" +
            "\"pay_price\": \"200\",\n" +
            "\"real_pay_price\": \"200\",\n" +
            "\"user_id\": \"5\",\n" +
            "\"order_date\": \"2020-03-26\",\n" +
            "\"pay_status\": \"0\"\n" +
//            "}]\n" +
            "}]";

    @Resource
    static TemplateMapper templateMapper;

    public static void main(String[] args) {

        AbstractCompany companyA = new CompanyA(templateMapper);
        companyA.insertData(jsonA);

        CompanyB companyB = new CompanyB(templateMapper);
        companyB.insertData(jsonB);

        CompanyC companyC = new CompanyC(templateMapper);
        companyC.insertData(jsonC);
        String str = "";
        System.out.println("str="+str);

    }



}
